Integrand size = 8, antiderivative size = 57 \[ \int x \cos (2 x) \sec (x) \, dx=2 i x \arctan \left (e^{i x}\right )+2 \cos (x)-i \operatorname {PolyLog}\left (2,-i e^{i x}\right )+i \operatorname {PolyLog}\left (2,i e^{i x}\right )+2 x \sin (x) \]
[Out]
Time = 0.09 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.875, Rules used = {4516, 3377, 2718, 4492, 4266, 2317, 2438} \[ \int x \cos (2 x) \sec (x) \, dx=2 i x \arctan \left (e^{i x}\right )-i \operatorname {PolyLog}\left (2,-i e^{i x}\right )+i \operatorname {PolyLog}\left (2,i e^{i x}\right )+2 x \sin (x)+2 \cos (x) \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 2718
Rule 3377
Rule 4266
Rule 4492
Rule 4516
Rubi steps \begin{align*} \text {integral}& = \int (x \cos (x)-x \sin (x) \tan (x)) \, dx \\ & = \int x \cos (x) \, dx-\int x \sin (x) \tan (x) \, dx \\ & = x \sin (x)+\int x \cos (x) \, dx-\int x \sec (x) \, dx-\int \sin (x) \, dx \\ & = 2 i x \arctan \left (e^{i x}\right )+\cos (x)+2 x \sin (x)+\int \log \left (1-i e^{i x}\right ) \, dx-\int \log \left (1+i e^{i x}\right ) \, dx-\int \sin (x) \, dx \\ & = 2 i x \arctan \left (e^{i x}\right )+2 \cos (x)+2 x \sin (x)-i \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i x}\right )+i \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i x}\right ) \\ & = 2 i x \arctan \left (e^{i x}\right )+2 \cos (x)-i \operatorname {PolyLog}\left (2,-i e^{i x}\right )+i \operatorname {PolyLog}\left (2,i e^{i x}\right )+2 x \sin (x) \\ \end{align*}
Time = 0.04 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.35 \[ \int x \cos (2 x) \sec (x) \, dx=2 \cos (x)-x \left (\log \left (1-i e^{i x}\right )-\log \left (1+i e^{i x}\right )\right )-i \left (\operatorname {PolyLog}\left (2,-i e^{i x}\right )-\operatorname {PolyLog}\left (2,i e^{i x}\right )\right )+2 x \sin (x) \]
[In]
[Out]
Time = 1.68 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.16
method | result | size |
default | \(x \ln \left (1+i {\mathrm e}^{i x}\right )-x \ln \left (1-i {\mathrm e}^{i x}\right )-i \operatorname {dilog}\left (1+i {\mathrm e}^{i x}\right )+i \operatorname {dilog}\left (1-i {\mathrm e}^{i x}\right )+2 \cos \left (x \right )+2 x \sin \left (x \right )\) | \(66\) |
risch | \(-i \left (x +i\right ) {\mathrm e}^{i x}+i \left (x -i\right ) {\mathrm e}^{-i x}+x \ln \left (1+i {\mathrm e}^{i x}\right )-x \ln \left (1-i {\mathrm e}^{i x}\right )-i \operatorname {dilog}\left (1+i {\mathrm e}^{i x}\right )+i \operatorname {dilog}\left (1-i {\mathrm e}^{i x}\right )\) | \(81\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 106 vs. \(2 (36) = 72\).
Time = 0.26 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.86 \[ \int x \cos (2 x) \sec (x) \, dx=-\frac {1}{2} \, x \log \left (i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) + \frac {1}{2} \, x \log \left (i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) - \frac {1}{2} \, x \log \left (-i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) + \frac {1}{2} \, x \log \left (-i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + 2 \, x \sin \left (x\right ) + 2 \, \cos \left (x\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \left (x\right ) + \sin \left (x\right )\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \left (x\right ) + \sin \left (x\right )\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, \cos \left (x\right ) - \sin \left (x\right )\right ) \]
[In]
[Out]
\[ \int x \cos (2 x) \sec (x) \, dx=\int x \cos {\left (2 x \right )} \sec {\left (x \right )}\, dx \]
[In]
[Out]
\[ \int x \cos (2 x) \sec (x) \, dx=\int { x \cos \left (2 \, x\right ) \sec \left (x\right ) \,d x } \]
[In]
[Out]
\[ \int x \cos (2 x) \sec (x) \, dx=\int { x \cos \left (2 \, x\right ) \sec \left (x\right ) \,d x } \]
[In]
[Out]
Time = 26.55 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.81 \[ \int x \cos (2 x) \sec (x) \, dx=2\,\cos \left (x\right )+2\,x\,\sin \left (x\right )-\mathrm {polylog}\left (2,-{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+\mathrm {polylog}\left (2,{\mathrm {e}}^{x\,1{}\mathrm {i}}\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+x\,\mathrm {atan}\left ({\mathrm {e}}^{x\,1{}\mathrm {i}}\right )\,2{}\mathrm {i} \]
[In]
[Out]